package cn.wolfcode.wolf2w.business.api.domain;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "note")//索引名称，生成的时候名字就会是 note
//es是索引，表叫类型，索引和类型是 es 的概念
//关于版本问题，我们用的是7
public class NoteEs {
    @Id
    private Long id;
    //拆词，需要用文本                 //分词器                    //搜索分词器
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String title;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String summary;


}
